package org.example.TankGan.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author cc
 * @date 2021/4/17 11:26
 * @Description
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Tank {
    private int x;//坦克的横坐标
    private int y;//坦克的纵坐标
    private int drection;
    private int speed=10;
    private int type; //0是自己，1是敌人

    public Tank(int x, int y, int drection, int speed) {
        this.x = x;
        this.y = y;
        this.drection = drection;
        this.speed = speed;
    }

    public void Upmove(){
        y-=speed;
    }
    public void downmove(){
        y+=speed;
    }
    public void leftMpve(){
        x-=speed;
    }
    public void rightMove(){
        x+=speed;
    }
}
